﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Preactor.ObjectModel.Entities
{
    using Preactor.ObjectModel.Interfaces;

    public class Order
    {
        public string OrderNumber { get; private set; }

        public DateTime DueDate { get; set; }

        public DateTime EarliestStartDate { get; set; }

        public List<IOperation> Operations { get; private set; }

        private IOperation ParentOperation { get; set; }

        public Order(IEnumerable<IOperation> operations )
        {
            Operations = operations.OrderBy(x => x.OperationNumber).ToList();
            ParentOperation = Operations.First();
            OrderNumber = ParentOperation.OrderNumber;
        }
    }
}
